package com.bistu.xiong.factory.model.api.account;

import com.bistu.xiong.factory.model.db.User;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by XiongXiaoJun on 2017/12/15.
 */

public class UpdateUserModel {
    private String username;
    private String password;
    private Integer sex;
    private String portrait;
    private String description;

    public UpdateUserModel(String portrait, String description, Integer sex) {
        this.sex = sex;
        this.portrait = portrait;
        this.description = description;
    }

    public UpdateUserModel(String username, String password, Integer sex, String portrait, String description) {
        this.username = username;
        this.password = password;
        this.sex = sex;
        this.portrait = portrait;
        this.description = description;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public String getPortrait() {
        return portrait;
    }

    public void setPortrait(String portrait) {
        this.portrait = portrait;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Map<String,String> getMap(){
        Map<String,String> map = new HashMap<>();
        if(username!=null)
            map.put("username",username);
        if(password!=null)
            map.put("password",password);
        if(sex!=null)
            map.put("sex",sex.toString());
        if(portrait!=null)
            map.put("portrait",portrait);
        if(description!=null)
            map.put("description",description);
        return map;
    }
}
